1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a storage medium, and more particularly, is suitable for use to reduce noise contained in an image.
2. Description of the Related Art
In recent years, the pixel size of image sensors has been decreased. The decrease in pixel size tends to cause more noise in image signals obtained from the image sensors. One of the methods of reducing the noise by signal processing is a method in which smoothing processing is performed using a pixel of interest and adjacent pixels in the neighborhood of the pixel of interest.
Japanese Patent Application Laid-Open No. 2000-69291 discusses a technique of changing characteristics of a smoothing filter based on noise characteristics of an input image. More specifically, if the amount of noise in the input image is large, the mask size is increased to perform the smoothing processing on a larger area. On the other hand, if the amount of noise in the input image is small, the mask size is decreased to maintain a value of the pixel of interest at an original value (or a value close to the original value).
Further, Japanese Patent Application Laid-Open No. 2010-153969 discusses a technique of weighting adjacent pixels according to a similarity to a pixel of interest of an input image. More specifically, the direction of an edge (the direction in which pixels having substantially a same pixel value are aligned) in a search region of the input image around the pixel of interest is detected, and pixels located along the direction of the edge are selected as selected comparison pixels. For example, if a result of calculation by an edge detection filter along a downward oblique direction from an upper left corner toward a lower right corner of a 5×5 pixel region including a pixel of interest at its center is the smallest value, then the downward oblique direction is the direction of the edge of the pixel of interest. Next, the degree of similarity between the pixel of interest and each selected comparison pixel is calculated, and the weighting factor is calculated for each selected comparison pixel. Then, the smoothing processing is performed on the weighted selected comparison pixels to calculate the pixel value of the pixel of interest.
However, according to the technique discussed in Japanese Patent Application Laid-Open No. 2000-69291, the number of pixels to be used in the smoothing processing varies depending on the amount of noise. Thus, pixels with different noise reduction effects are dispersed in the image. This causes a problem that spots are clearly visible on an image having undergone the noise reduction processing.
Further, according to the technique discussed in Japanese Patent Application Laid-Open No. 2010-153969, the number of pixels to be used in smoothing processing also varies depending on whether a region includes an edge. Thus, in a region including an edge, the noise reduction effect is small. On the other hand, in an even region including no edge, the noise reduction effect is large. Thus, pixels with different noise reduction effects are dispersed in the image. This causes a problem that spots are clearly visible on an image having undergone the noise reduction processing.